home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000091_icon-group-sender _Wed Jun 17 09:13:55 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
4KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id JAA10731
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 17 Jun 1998 09:13:51 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA21188; Wed, 17 Jun 1998 09:13:41 -0700
From: gep2@computek.net
Date: Tue, 16 Jun 1998 20:34:21 -0500
Message-Id: <199806170134.UAA19159@axp.cmpu.net>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Subject: Re: Directory access facilities
To: icon-group@optima.CS.Arizona.EDU
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 3521
>>> My admittedly biased and possibly Unix-centric view: we don't need any
>elaborate solutions, I think the idea of each read() returning one entry
>from the directory is the best one. This finesses all the issues of quoting
>blanks, quotes, wildchars etc. etc.
>> "Finesses" -> "Ignores".
> But in this case, ignoring them is the Right Solution.
I suppose you're entitled to your opinion, but I certainly don't agree.
>>The problem (if you want something RELIABLE) with this kind of thing is
that on multitasking systems (especially those crossing boundaries through a
network) the entries can be changing (and entries even being added and deleted)
WHILE you are retrieving your way through them. It's much more robust to return
a snapshot, which at least _was_ valid and consistent at the time the
snapshot was taken.
> It's not ANY more robust, since the underlying C calls (which the Icon
runtime has to make in order to get the data) make no atomicity guarantees
(on Unix, MacOS, etc.) when querying all the entries in a directory.
I don't argue that there might be bugs in the underlying calls, but the point is
that you're using those current bugs as an excuse to propagate those BY DESIGN
into the higher levels too.
It's entirely possible that one COULD fix the underlying problems... but it
wouldn't help if the higher levels were still inherently unsound.
>> It's entirely possible that (for example) the read(f) returns a temporary
file name, which is no longer there by the time the stat() is issued for it.
> And how is this magically fixed?
In this case, because you (presumably) wouldn't have to call STAT() at all.
Even if it DID fail after a call, you would probably need to deal with that
status differently than the "ambiguous failure" problem in the code's WHILE loop
as was listed
> This happens with the C API, which means that it will happen with the Icon
API. Pretending it doesn't won't make the problem go away.
Again, it's one thing for there to be a bug in the underlying API. It's another
thing entirely for that inherently poor design to propagate those faults to
higher level programs.
>>If stat() failed (e.g.) in such a case, then you'd terminate your while loop
>prematurely.
>Which makes the code incorrect even with your solution, since the window of
vunerability between the time you get the filename and the time you stat the
file is still there.
If you get a table with filenames and directories, then you don't have to STAT
yourself to find out whether you need to recurse or not.
> In either case, the code has to be modifed to something like
> every s := Files(sDirectory) do {
write(format(stat(s)))
}
>> Like the old saying, it should be "as simple as possible... BUT NO
SIMPLER."
> And the solution where we have a function that generates directory entries
(and I don't believe we should overload read(), since this shares almost
nothing in common with read()) is, IMHO, that solution.
Again, you're entitled to your opinion. But I still don't agree with you.
> What you are trying to graft onto it are atomicity guarantees, and that is
impossible since you need the underlying OS to make those guarantees.
It's not impossible that someday the underlying OS WILL make those guarantees.
If the supporting calls are such that they are still ineffective, then fixing it
in the OS doesn't solve anything.
Gordon Peterson
http://www.computek.net/public/gep2/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/